<!doctype html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <title>Document</title>
</head>

<body>
<script src="vue.min.js"></script>
<!-- id标识vue作用的范围 -->
<div id="app">
    <!-- v-bind:value只能进行单向的数据渲染 -->
    <input type="button" value="b1" v-on:click="search()">

    <input type="button" value="b2" @click="search()">
</div>

<script>
    // 创建一个vue对象
    new Vue({
        el: '#app',//绑定vue作用的范围
        data: {//定义页面中显示的模型数据
            time: 0
        },
        methods: {
            search(){
                console.log('search'+this.time);
                this.time=this.time+1;
            }
        }

    })
</script>
</body>
</html>
